package cn.wxManage.goodsManage.service.impl;

import cn.common.common.model.ServerResponse;
import cn.wxManage.goodsManage.service.IGoodsTypeService;
import cn.wxManage.goodsManage.dao.GoodsTypeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Zhang on 2018/12/11.
 */
@Service
public class GoodsTypeService implements IGoodsTypeService {

    @Autowired
    GoodsTypeMapper goodsTypeMapper;

    @Override
    public ServerResponse<?> getGoodsTypeList(String fatherId) {
        Integer id;
        if ("".equals(fatherId) || fatherId == null){
            id = null;
        }else {
            id = Integer.parseInt(fatherId);
        }
        return ServerResponse.createBySuccess(goodsTypeMapper.getGoodsTypeList(id));
    }
}
